home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / osi / isode / dosisode / DOSISODE80.ZIP / ISODE8.WRK / H / GENERAL.H_N < prev    next >
Encoding:
Text File  |  1992-06-27  |  4.5 KB  |  290 lines

  1. /* general.h - general compatibility */
  2.  
  3. /* 
  4.  * $Header: /xtel/isode/isode/h/RCS/general.h,v 9.0 1992/06/16 12:17:57 isode Rel $
  5.  *
  6.  *
  7.  * $Log: general.h,v $
  8.  * Revision 9.0  1992/06/16  12:17:57  isode
  9.  * Release 8.0
  10.  *
  11.  */
  12.  
  13. /*
  14.  *                  NOTICE
  15.  *
  16.  *    Acquisition, use, and distribution of this module and related
  17.  *    materials are subject to the restrictions of a license agreement.
  18.  *    Consult the Preface in the User's Manual for the full terms of
  19.  *    this agreement.
  20.  *
  21.  */
  22.  
  23.  
  24. #ifndef    _GENERAL_
  25. #define    _GENERAL_
  26.  
  27. #ifndef    _CONFIG_
  28. #include "config.h"        /* system-specific configuration */
  29. #endif
  30.  
  31.  
  32. /* target-dependent defines:
  33.  
  34.     BSDFORK -    target has BSD vfork
  35.     BSDLIBC -    target has real BSD libc
  36.     BSDSTRS -    target has BSD strings
  37.     SWABLIB -    target has byteorder(3n) routines
  38.  */
  39.  
  40. #ifdef    SOCKETS
  41. #define    SWABLIB
  42. #endif
  43.  
  44. #ifdef    WINTLI
  45. #define    SWABLIB
  46. #endif
  47.  
  48. #ifdef    EXOS
  49. #define    SWABLIB
  50. #endif
  51.  
  52.  
  53. #ifdef    BSD42
  54. #define    BSDFORK
  55. #define    BSDLIBC
  56. #define    BSDSTRS
  57. #endif
  58.  
  59. #ifdef  SVR4_UCB
  60. #ifndef SVR4
  61. #define SVR4
  62. #endif
  63. #endif
  64.  
  65. #ifdef  SVR4
  66. #ifndef SVR3
  67. #define SVR3
  68. #endif
  69. #endif
  70.  
  71. #ifdef    ROS
  72. #undef    BSDFORK
  73. #undef    BSDLIBC
  74. #define    BSDSTRS
  75. #ifndef    BSD42
  76. #define    BSD42
  77. #endif
  78. #undef    SWABLIB
  79. #endif
  80.  
  81. #ifdef    SYS5
  82. #undef    BSDFORK
  83. #undef    BSDLIBC
  84. #undef    BSDSTRS
  85. #endif
  86.  
  87. #ifdef    sgi
  88. #undef    BSDFORK
  89. #undef    BSDLIBC
  90. #undef    BSDSTRS
  91. #endif
  92.  
  93. #ifdef    HPUX
  94. #define    BSDFORK
  95. #undef    BSDLIBC
  96. #undef    BSDSTRS
  97. #undef    SWABLIB
  98. #endif
  99.  
  100. #ifdef    pyr
  101. #undef    SWABLIB
  102. #endif
  103.  
  104. #ifdef    XOS
  105. #undef    SWABLIB
  106. #endif
  107.  
  108. #ifdef    XOS_2
  109. #undef    SWABLIB
  110. #endif
  111.  
  112. #ifdef  apollo
  113. #undef  SWABLIB
  114. #endif
  115.  
  116. #ifdef    AUX
  117. #undef    BSDFORK
  118. #define BSDSTRS
  119. #undef SWABLIB
  120. #define BSDLIBC
  121. #endif 
  122.  
  123. #if defined(_AIX) && defined(SYS5)
  124. #define BSDSTRS
  125. #endif
  126.  
  127. #ifndef    BSDFORK
  128. #define    vfork    fork
  129. #endif
  130.  
  131. /*     STRINGS */
  132.  
  133. #if defined(SVR4) || defined (__NeXT__)
  134. #include <stdio.h>
  135. #include <stdlib.h>
  136.  
  137. #else /* SVR4 */
  138.  
  139. #if    defined(BSDSTRS) && !defined(BSD44) && (!defined(BSD43) || defined(SUNOS4) || defined(vax) || defined(RT) || (defined(mips) && defined(ultrix))) && !defined(XOS_2)
  140. #if !(defined(__STDC__) && defined(__GNUC__) && defined(mips) && defined(ultrix))
  141. /*char   *sprintf ();*/
  142. #endif
  143. #else
  144. int     sprintf ();
  145. #endif
  146.  
  147. char   *getenv ();
  148. char   *mktemp ();
  149.  
  150. #endif /* SVR4 */
  151.  
  152. #ifdef __STDC__
  153. #ifndef __NeXT__
  154. #include <malloc.h>
  155. #endif
  156. #else
  157. #if defined(BSD44) || defined(_AIX)
  158. void   *calloc (), *malloc (), *realloc ();
  159. void free();
  160. #else
  161. char   *calloc (), *malloc (), *realloc ();
  162. int free();
  163. #endif /* defined BSD44 */
  164. #endif
  165.  
  166.  
  167. #ifndef    BSDSTRS
  168. #define    index    strchr
  169. #define    rindex    strrchr
  170. #include <string.h>
  171. #else
  172. #include <strings.h>
  173. #endif
  174.  
  175. #if    defined(SYS5) && !defined(_AIX) && !defined(XOS) && !defined(XOS_2)
  176. #include <memory.h>
  177.  
  178. #define    bcopy(b1,b2,length)    (void) memcpy ((b2), (b1), (length))
  179. #define    bcmp(b1,b2,length)    memcmp ((b1), (b2), (length))
  180. #define    bzero(b,length)        (void) memset ((b), 0, (length))
  181. #endif
  182. /*     HEXIFY */
  183.  
  184. int    explode (), implode ();
  185.  
  186. /*     SPRINTB */
  187.  
  188. char   *sprintb ();
  189.  
  190. /*     STR2VEC */
  191.  
  192. #define    NVEC    100
  193. #define    NSLACK    10
  194.  
  195.  
  196. #define    str2vec(s,v)    str2vecX ((s), (v), 0, NULLIP, NULL, 1)
  197.  
  198. int    str2vecX ();
  199.  
  200. /*     STR2ELEM */
  201.  
  202. #define    NELEM    100
  203.  
  204. int    str2elem ();
  205.  
  206. /*     STR2SEL */
  207.  
  208. int    str2sel ();
  209. char   *sel2str ();
  210.  
  211. /*     GETPASS */
  212.  
  213. char   *getpassword ();
  214.  
  215. /*     BADUSER */
  216.  
  217. int    baduser ();
  218.  
  219. /*    UTILITIES */
  220.  
  221. extern char chrcnv[], nochrcnv[];
  222.  
  223.  
  224. int    lexequ (), lexnequ ();
  225.  
  226. int    log_tai ();
  227.  
  228. int    sstr2arg ();
  229.  
  230. void    (*set_smalloc_handler()) ();
  231. char    *smalloc (), *strdup ();
  232.  
  233. /*     MISC */
  234.  
  235. char   *sys_errname ();
  236.  
  237. #ifdef    lint
  238. #define    insque(e,p)    INSQUE ((char *) (e), (char *) (p))
  239. #define    remque(e)    REMQUE ((char *) (e))
  240. #endif
  241.  
  242.  
  243. void    asprintf (), _asprintf ();
  244.  
  245. void    isodetailor ();        /* also in tailor.h */
  246.  
  247.  
  248. /*   time */
  249.  
  250. #ifndef makedev
  251. #include <sys/types.h>
  252. #endif
  253. #ifndef    OSX
  254. #ifndef    BSD42
  255. #ifdef _AIX
  256. #include <sys/time.h>        /* Why is AIX always different ! */
  257. #endif
  258. #include <time.h>
  259. #else  /* BSD42 */
  260. #ifndef    timerisset
  261. #include <sys/time.h>
  262. #endif /* timerisset */
  263. #endif /* BSD42 */
  264. #endif /* OSX */
  265.  
  266. #ifndef __STDC__
  267. extern time_t time ();
  268. #endif
  269.  
  270.  
  271. /*   ntohs etc */
  272.  
  273. #ifndef    ntohs
  274. unsigned short    ntohs ();
  275. #endif
  276. #ifndef    htons
  277. unsigned short    htons ();
  278. #endif
  279. #ifndef    ntohl
  280. unsigned long    ntohl ();
  281. #endif
  282. #ifndef    htonl
  283. unsigned long    htonl ();
  284. #endif
  285.  
  286. int    char2bcd ();
  287. int    bcd2char ();
  288.  
  289. #endif
  290.